Note: There is a newly maintained community documentation site for all of Trackmania's APIs!
Visit it at: https://webservices.openplanet.dev/
This guide will explain how to authenticate with Nadeo's API. There are 2 methods of doing so, one is via a Ubisoft account, and one is via a dedicated server account. Note that the dedicated server account way is easier but imposes some limitations on what you can access with the API, but it could be enough.
Refer to my Nadeo Go package for a complete example.